total_cost = 100
num_people = 6
total_power_consumption = 0
people_info = []

for i in range(num_people):
    power_list = []
    time_list = []
    print(f"请输入第 {i + 1} 个人的电器信息。")
    while True:
        try:
            power = float(input("请输入电器功率："))
            time = float(input("请输入平均每天使用时间："))
            power_list.append(power)
            time_list.append(time)
            choice = input("是否还有其他电器？(y/n)")
            if choice.lower()!= 'y':
                break
        except ValueError:
            print("输入错误，请重新输入。")
    total_power = sum([p * t for p, t in zip(power_list, time_list)])
    people_info.append(total_power)
    total_power_consumption += total_power

for power, person in zip(people_info, range(1, num_people + 1)):
    cost = (power / total_power_consumption) * total_cost
    print(f"第 {person} 个人应出 {cost:.2f} 元电费。")
